﻿using EmbeddedSensorCloud.Plugin;
using System;

namespace EmbeddedSensorCloud.Core.Plugin
{
    public class AvailablePlugin
    {
        /// <summary>
        /// The path of the plugin file in the filesystem.
        /// </summary>
        public string Path { get; private set; }

        /// <summary>
        /// The plugin source which inherites the interface IPlugin.
        /// </summary>
        public IPlugin Instance { get; private set; }

        /// <summary>
        /// Plugin name
        /// </summary>
        public string Name { get; private set; }

        /// <summary>
        /// Plugin version (Major.Minor.SubMinor.Build)
        /// </summary>
        public Version Version { get; private set; }

        /// <summary>
        /// Plugin type
        /// </summary>
        public Type Type { get; private set; }

        /// <summary>
        /// Initialize a new plugin object with a specified plugin file path, the created plugin object file which inherites from the IPlugin interface, the plugin name and the plugin version.
        /// </summary>
        /// <param name="path">The path of the plugin file in the filesystem.</param>
        /// <param name="instance">The plugin source which inherites the interface IPlugin.</param>
        /// <param name="name">Plugin name</param>
        /// <param name="version">Plugin version (Major.Minor.SubMinor.Build)</param>
        public AvailablePlugin(Type type, string path, IPlugin instance, string name, Version version)
        {
            this.Type = type;
            this.Path = path;
            this.Instance = instance;
            this.Name = name;
            this.Version = version;
        }
    }
}
